package com.example.communist_app_api.service;

import com.example.communist_app_api.db.dto.WordDTO;
import com.example.communist_app_api.db.pojoDto.Word;
import com.example.communist_app_api.vo.web.resp.SensitiveWordApiResp;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface WordService {
    //从数据库中寻找 状态status为正常，类型type是允许的单词
    List<String> selectAllWordByNormalAndAllow();

    //从数据库中寻找 状态status为正常，类型type是禁止的单词
    List<String> selectAllWordByNormalAndDeny();

    //新增word对象
    Integer insert(Word wordEntity);

    //删除word对象
    Integer delete(Integer id);

    //更新word对象
    Integer update(Word wordEntity);

    //根据Word设置的条件搜索
    PageInfo<Word>  selectByCondition(Word wordEntity,Integer pageNum ,Integer pageSize);

    //批量新增
    Integer batchInsert(List<WordDTO> wordInsertList);

    //检测敏感词接口
    //receiverId传的是小程序用户ID，返回值判断为true时已经向用户发送消息，不用存数据库;判断失败false才可以存数据库
    SensitiveWordApiResp detectSensitiveWord(String text,String receiverId);
}
